﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class ProductLayout : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["User"] != "")
        {
            btnLogout.Visible = true;
            lblWelcome.Visible = true;
            lblUser.Visible = true;
            lblWelcome.Text = "Welcome";
            lblUser.Text = Session["User"].ToString();
            txtUser.Visible = false;
            txtPass.Visible = false;
            btnLogin.Visible = false;

        }
        else
        {
            btnLogout.Visible = false;
            lblWelcome.Visible = false;
            lblUser.Visible = false;
            txtUser.Visible = true;
            txtPass.Visible = true;
            btnLogin.Visible = true;
            Response.Redirect("Default.aspx");
            
        }
    }
    protected void btnLogin_Click(object sender, EventArgs e)
    {

    }
    protected void btnLogout_Click(object sender, EventArgs e)
    {
        Session["User"] = "";
        btnLogout.Visible = false;
        lblWelcome.Visible = false;
        lblUser.Visible = false;
        txtUser.Visible = true;
        txtPass.Visible = true;
        btnLogin.Visible = true;
        Response.Redirect("Default.aspx");
    }
}
